import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/sys-admin/LoginView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/sys-admin',
    component: () => import('../views/sys-admin/HomeView.vue'),
    redirect: '/sys-admin/index',
    children: [
      {
        path: 'index',
        component: () => import('../views/sys-admin/Index.vue')
      },
      {
        path: 'temp/brand-list',
        component: () => import('../views/sys-admin/temp/BrandList.vue')
      },
      {
        path: 'temp/brand-add',
        component: () => import('../views/sys-admin/temp/BrandAdd.vue')
      }
    ]
  },
  {
    path: '/',
    component: LoginView
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
